package cn.sirun.com.fca.account.loader;

import com.tencent.cloud.iov.kernel.model.BaseResponse;

import cn.sirun.com.fca.account.model.login.AuthenticateRequest;
import cn.sirun.com.fca.account.model.login.AuthenticateResponse;
import cn.sirun.com.fca.account.model.login.ChallengeResponse;
import cn.sirun.com.fca.account.repo.login.LoginRepository;
import cn.sirun.com.fca.account.repo.modify.ModifyPassRepository;
import cn.sirun.com.fca.account.repo.reset.ResetRepository;
import io.reactivex.Observable;
import io.reactivex.schedulers.Schedulers;

public class ConfirmPasswordLoader extends AccountFlowLoader {

    public Observable<BaseResponse<ChallengeResponse>> getChallenge() {
        return ModifyPassRepository.getInstance().getChallenge()
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<AuthenticateResponse>> authenticate(
            AuthenticateRequest request) {
        return ModifyPassRepository.getInstance().authenticate(request)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<ChallengeResponse>> getSetParams() {
        return ModifyPassRepository.getInstance().getSetParams()
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<Void>> setPassword(String password) {
        return ModifyPassRepository.getInstance().setPassword(password)
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<ChallengeResponse>> changeGetChallenge() {
        return ModifyPassRepository.getInstance().changeGetChallenge()
                .subscribeOn(Schedulers.io());
    }

    public Observable<BaseResponse<AuthenticateResponse>> changeAuthenticate(
            AuthenticateRequest request) {
        return ModifyPassRepository.getInstance().changeAuthenticate(request)
                .subscribeOn(Schedulers.io());
    }

}
